package com.oocl.server.po;

import java.sql.Date;

public class Person {

	private int pid;
	private String pname;
	private Date birthday;
	private String tel;
	private int did;
	private int salary;
	private Deptment dept;

	public int getPid() {
		return pid;
	}

	public void setPid(int pid) {
		this.pid = pid;
	}

	public String getPname() {
		return pname;
	}

	public void setPname(String pname) {
		this.pname = pname;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public int getDid() {
		return did;
	}

	public void setDid(int did) {
		this.did = did;
	}

	public int getSalary() {
		return salary;
	}

	public void setSalary(int salary) {
		this.salary = salary;
	}

	public Deptment getDept() {
		return dept;
	}

	public void setDept(Deptment dept) {
		this.dept = dept;
	}

	public String toString() {
		String personStr = "";
		personStr = "pid: " + getPid() + " pname: " + getPname() + " birthday: " + getBirthday() + " tel: " + getTel()
				+ " did: " + getDid() + " salary: " + getSalary();
		return personStr;
	}

	public String toStringWithDept() {
		String personStr = "";
		personStr = "pid: " + getPid() + " pname: " + getPname() + " birthday: " + getBirthday() + " tel: " + getTel()
				+ " did: " + getDid() + " salary: " + getSalary() + " dname: "
				+ getDept().getDname() + " city: " + getDept().getCity();

		return personStr;
	}
}
